package com.bluesky.javawebbrowser.domain.html.tags.table;

import java.util.List;

import com.bluesky.javawebbrowser.domain.html.tags.Tag;
import com.bluesky.javawebbrowser.domain.html.tags.TagType;
import com.bluesky.javawebbrowser.domain.html.tags.form.input.InputType;

public class Table extends Tag {

	Integer border = 0;

	public Integer getBorder() {
		return border;
	}

	public void setBorder(Integer border) {
		this.border = border;
		attributes.put("border", border.toString());
	}

	public Table() {
		super(TagType.TABLE);
	}

	public Table(Tag tag) {
		super(TagType.TABLE);
		
		copy(tag);

		

		
		
	}

	public void addRow(TR tr) {
		addChild(tr);
	}

	public void fill(List<Tag[]> tags) {
		for (Tag[] t1 : tags) {

			TR tr = new TR();

			tr.addColums(t1);

			addRow(tr);
		}
	}

	public TR getLastRow() {
		if (!getChildren().isEmpty()) {
			TR tr = (TR) getChildren().get(getChildren().size() - 1);
			return tr;
		}
		else return null;
	}

}
